#include "Interpolation.h"

class Function1 : public Function
{
public:
    double operator()(double x)
    {
        return 1 / (x * x + 1);
    }
};

int main()
{
    vector<double> x, y, z;
    Function1 f;
    for (int i = 2; i <= 8; i += 2)
    {
        for (int j = 0; j <= i; j++)
        {
            double zw = -5 + 10.0 * j / i;
            x.push_back(zw);
            y.push_back(f(zw));
        }
        Newton np(i, x, y);
        np.Newtonpolation();
        np.printpolynomial();
        x.clear();
        y.clear();
        z.clear();
    }
}